home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Ham Radio 2000
/
Ham Radio 2000.iso
/
ham2000
/
misc
/
qsocord
/
qso23.asm
< prev
next >
Wrap
Assembly Source File
|
1993-10-17
|
23KB
|
721 lines
;---------------------------------------------------
;
; QSOxx.ASM
;
; QSOcorder
;
; Digital Audio "Instant Replay" Unit
;
;
; Dr. Steven E. Reyer, WA9VNJ
;
; Reyer & Associates
; P.O. Box 17821
; Milwaukee, WI 53217
; USA
;
;---------------------------------------------------
; For personal, noncommercial use only.
;---------------------------------------------------
;
; NOTE: version number and date appear on
; ROM page 3, and on the top of the
; following lines.
;
; v. 2.3 - 10/17/93 - include NOPs for JNT1 on pwr-up
; v. 2.2 - 09/29/93 - remove unnecessary subroutines
; v. 2.1 - 08/10/93 - change manual reboot method
; v. 2.0 - 08/09/93 - add manual record mode
; v. 1.2 - 08/07/93 - include clear RAM routine
; v. 1.1 - 08/07/93 - shorten record loop to 42/55
; v. 1.0 - 08/06/93 - original program
;
;---------------------------------------------------
;
; This program runs on an Intel 8748H (high speed version)
; microcontroller to allow "Instant Replay" of received
; communications quality audio. It requires two 62256
; RAMs (32K x 8), an Analog Devices AD7569 8-bit audio
; I/O port, a 74LS374/574 demultiplexing latch, and
; analog antialiasing and reconstruction lowpass filters,
; and speaker driver amplifier, such as an LM380.
;
; The crystal required is 11 MHz (or 11.0592 MHz, which
; exceeds the specification of the 8748H, but not by very
; much, and should work fine in most instances).
;
; Three switches to control the system are connected as
; follows:
; T0 (pin 1) - 10 second repeat pushbutton
; T1 (pin 39)- 5 second repeat pushbutton
; INT (pin 6) - Sample rate selector
; (open = 13.41 kHz)
; (ground = 17.55 kHz)
;
; The sample rate determines the quality of the replayed
; audio, as well as the duration. At the slow rate, the
; "10 second" switch plays for 9.8 seconds, and the
; "5 second" switch plays for 4.9 seconds. At the fast
; rate, the times are 7.5 and 3.7 seconds. At the slow
; rate, there will be some reconstruction noise, since
; the storage algorithm uses a /2 decimation, and a
; corresponding x2 interpolation, with simple 2-point
; averaging digital filtering. With the 3 kHz, 3rd order
; Chebyshev lowpass filters, this causes images from the
; sampling/decimation to be heard. A 3 kHz input signal
; will image to a resulting -30 dB at the fast rate, and
; -10 dB at the slow rate. Thus, the trade-off is between
; better quality vs. longer record time. Fortunately,
; ham radio applications will involve signals with little
; high frequency power.
;
; There are 42 states between samples at the fast rate,
; and 55 states at the slow rate. With the 11.0592 MHz
; clock, each state takes about 1.356 microseconds,
; = (15/11.0592) microseconds.
;
; The RAM address is multiplexed onto Port 1, and
; demultiplexed with the 74LS374 latch. The latch
; holds the MS bits, and Port 1 holds the LS bits.
; The MS bit of the latch operates the overload LED.
; Data transfers are made on the "BUS." Port 2 is used
; to construct the control signals as follows:
;
; Port bit Pin Signal
; P27 38 CS1- to RAM 1
; P26 37 CS0- to RAM 0
; P25 36 WE- to RAMs
; P24 35 OE- to RAMs
; P23 24 WR- to AD7569
; P22 23 ST- to AD7569
; P21 22 RD- to AD7569
; P20 21 LATCH- to 74LS374
;
;Note: ST- starts the A/D converter on the falling edge.
; It is a normally-low signal.
;
; Registers used are as follows:
;
; R7 - MS start address in buffer/temp constant 0
; R6 - LS start address in buffer
; R5 - MS end address
; R4 - Temporary sample storage
; R3 - Temporary sample storage
; R2 - MS current address pointer
; R1 - LS current address pointer
; R0 - sample average
;
;There are two modes of operation in the QSOcorder:
;
; AUTOMATIC MODE:
; ---------------
; When a "play" is requested, R7/R6 hold the computed
; starting "play address." This is either 5 seconds
; or 10 seconds earlier than the present buffer address.
; R5 is used to hold the MS end address, so the "play"
; knows when to stop and return to the "start" address
; to continue playing. R2/R1 are used as a temporary
; address during playing. When playing is no longer
; requested, R5/R6 are put into R2/R1 to continue
; recording. This will cause recording to begin at the
; same place it was halted when the play request was made.
; Playing continues as long as a play button is pressed.
;
; An "Overload LED" is connected to the latch MSB and is
; used to set the receiver audio gain. Adjust the
; receiver audio until the LED just flickers, and then
; back-off the setting a small amount. Too much receiver
; audio will cause some distortion, and too little will
; allow quantizing noise to be heard.
;
;
; MANUAL MODE:
; ------------
; Manual mode is entered by holding the 10-second push-
; button down while powering-up the system. It will then
; enter the 1 second memory clear routine, and finally
; enter manual mode and light up the LED. This indicates
; it is idling, and ready for a record command. The record
; command consists of a quick press of the 10 second button.
; The LED will extinguish, and a 10 second recording will
; be made, after which the system lights up the LED and
; awaits a play command. This is similarly caused by a quick
; press of the 10 second button. It will play the complete
; 10 seconds, and return to the play-idle state, awaiting
; another play command. Whenever the LED is on, in either
; idle state, the mode may be cancelled by a quick press
; of the 5 second button. The system will then enter the
; automatic mode immediately. The manual mode can only
; be reentered by the power-up technique described above.
;
; The playback sample rate in manual mode will vary
; depending on whether the 10 second button is being
; pressed. This will also happen during record mode.
; The variation is from 17.55 kHz to 16.75 kHz which
; causes a noticible change on music but is barely
; detectable on voice.
;
; There is a 1 second delay (with LED on) upon power-up
; in either mode, for the RAM-clear routine.
;
;--------------------------------------------------------
;------------------- Memory Page 0 ----------------------
;--------------------------------------------------------
ORG 0000H ;Start of EPROM memory
START DIS I ;Turn off external interrupt
DIS TCNTI ;...and timer counter int
CALL INIT ;Initialize ports and data
JNT0 MANA ;Manual record mode request
NOP ;Room for JNT1 on power up
NOP ;Same
CALL CLEAR ;Clear all of RAM memory
;----------------- Using RAM chip 0 ---------------------
;--------------------- RECORD ---------------------------
;Reset the start address to previous end address
REC0X JF1 PLAY0A ;If manual, keep playing
RECMAN MOV A,R5 ;Get MS end addr byte
MOV R2,A ;Put into counter
MOV A,R6 ;Get LS end addr byte
MOV R1,A ;Put into counter
MOV R7,#0 ;Constant zero
;Start the A/D converter states
REC0 ORL P2,#00000100B ;ST- = 1 2
ANL P2,#11111011B ;ST- = 0 2 A/D
JNI FAST0A ;Fast sampling? 2
CALL WAIT13 ;No, add 13 states (13)
;Read the A/D converter into accum
FAST0A MOVX A,@R1 ;Dummy to reset BUS 2
ANL P2,#11111101B ;RD- = 0 2
INS A,BUS ;Read A/D on BUS 2
ORL P2,#00000010B ;RD- = 1 2
;Send accum data to D/A converter
OUTL BUS,A ;Send data to BUS 2
ANL P2,#10110110B ;WR-,LATCH-,CS0-=0 2
ORL P2,#00001000B ;WR- = 1 2 D/A
MOV R4,A ;Save sample 1
;Check whether overload is occurring. F0=1=yes.
MOV A,R2 ;MS byte addr 1
ANL A,#01111111B ;Turn LED on 2
JF0 ON0A ;Should be on? 2
ORL A,#10000000B ;No, turn off 2
JMP OFF0A ;Continue 2
ON0A NOP ;Pad timing (1)
NOP ; (1)
NOP ; (1)
NOP ; (1)
;Put sample average into RAM at current address
;Send address to latches
OFF0A OUTL P1,A ;Out to port 1 2
ORL P2,#00000001B ;LATCH- = 1 2
MOV A,R1 ;LS byte addr 1
OUTL P1,A ;Out to port 1 2
;Send data to RAM
MOV A,R0 ;Get sample average 1
OUTL BUS,A ;Put onto BUS 2
ANL P2,#11011111B ;WE- = 0 2
ORL P2,#00100100B ;WE-=1, ST-=1 2
;Start the A/D converter
ANL P2,#11111011B ;ST- = 0 2 A/D
JNI FAST0B ;Fast sampling? 2
CALL WAIT13 ;No, add 13 states (13)
;Read the A/D converter into accum
FAST0B MOVX A,@R1 ;Dummy to reset BUS 2
ANL P2,#11111101B ;RD- = 0 2
INS A,BUS ;Read A/D data on BUS 2
ORL P2,#01000010B ;RD-=1;CS0-=1 2
;Send accum data to D/A converter
OUTL BUS,A ;Send data to BUS 2
ANL P2,#11110111B ;WR- = 0 2
ORL P2,#00001000B ;WR- = 1 2 D/A
;Check for overload - set F0 if yes.
CLR F0 ;LED flag off 1
JNZ OFF0B ;Overload? 2
CPL F0 ;Yes! Turn on (1)
JMP ON0B ;Continue (2)
OFF0B NOP ;Pad timing 1
NOP ; 1
NOP ; 1
;Find the average
ON0B ADD A,R4 ;Add old sample 1
RRC A ;Average the two 1
MOV R0,A ;Save for later 1
;Increment address counters in R2:R1
MOV A,R1 ;Get LS byte 1
ADD A,#1 ;Bump LS byte 2
MOV R1,A ;Replace 1
MOV A,R2 ;Get MS byte 1
ADDC A,R7 ;Add carry + (R7=0) 1
MOV R2,A ;Replace 1
JB7 TEST1A ;Change RAM? 2
TEST0 JT1 TA ;T1 up? Check T0 2
MOV A,R2 ;No, fix start addr
XRL A,#10000000B ;Addr 5 secs back
MOV R7,A ;Save as MS start
JMP PL0 ;Now play
TA JT0 REC0 ;T0 up? Keep rec. 2
JF1 REC0 ;Manual, ignore T0
MOV A,R2 ;Addr 10 secs back
MOV R7,A ;Save as MS start
PL0 MOV A,R1 ;LS byte addr
MOV R6,A ;Save LS start/end
MOV A,R2 ;Get MS addr end
MOV R5,A ;Save as MS end
;Set starting address for playing
START0 MOV A,R7 ;Get MS start
MOV R2,A ;Into counter
MOV A,R6 ;Get LS start
MOV R1,A ;Into counter
;------------------- PLAY --------------------------
;Get a byte from current address into accum
;Send address to latches
PLAY0 MOVX A,@R1 ;Dummy to reset BUS 2
ANL P2,#10111111B ;CS0- = 0 2
MOV A,R2 ;MS byte addr 1
ORL A,#10000000B ;Turn off LED 2
OUTL P1,A ;Out to port 1 2
ANL P2,#11111110B ;LATCH- = 0 2
ORL P2,#00000001B ;LATCH- = 1 2
MOV A,R1 ;LS byte addr 1
OUTL P1,A ;Out to port 1 2
ANL P2,#11101111B ;OE- = 0 2
INS A,BUS ;Read RAM data on BUS 2
ORL P2,#00010000B ;OE- = 1 2
ORL P2,#01000000B ;CS0- = 1 2
;Find the average
MOV R3,A ;Save sample for now 1
ADD A,R4 ;R4 = old sample 1
RRC A ;Find average 1
NOP ;Pad timing 1
NOP ; 1
NOP ; 1
NOP ; 1
NOP ; 1
;Send accum data to D/A converter
JNI FAST0C ;Fast sampling? 2
CALL WAIT13 ;No, add 13 states (13)
FAST0C OUTL BUS,A ;Send data to BUS 2
ANL P2,#11110111B ;WR- = 0 2
ORL P2,#00001000B ;WR- = 1 2 D/A
;Increment address counters in R2:R1
MOV A,R1 ;Get LS byte 1
ADD A,#1 ;Bump LS byte 2
MOV R1,A ;Replace 1
MOV A,R2 ;Get MS byte 1
ADDC A,#0 ;Add carry 2
MOV R2,A ;Replace 1
JB7 TST1A ;Change RAM? 2
MOV A,R1 ;Get LS addr 1
XRL A,R6 ;At end? 1
JNZ TST0 ;Not yet 2
MOV A,R2 ;Get MS addr
XRL A,R5 ;At end?
JZ START0 ;Yes, restart
TST0 JT1 TB ;T1 up? 2
JMP PLAY0A ;No, play sound 2
TB JT0 REC0X ;Finished playing?
PLAY0A MOV A,R3 ;Recall new sample 1
MOV R4,A ;Make into old 1
CALL WAIT13 ;Wait 13 states 13
NOP ;Pad timing 1
;Send sample to D/A converter
JNI FAST0D ;Fast sampling? 2
CALL WAIT13 ;No, add 13 states (13)
FAST0D OUTL BUS,A ;Send data to BUS 2
ANL P2,#11110111B ;WR- = 0 2
ORL P2,#00001000B ;WR- = 1 2 D/A
JMP PLAY0 ;Keep playing 2
TEST1A JMP TEST1 ;Cross page jumps
TST1A JMP TST1
MANA JMP MANUAL
;--------------------------------------------------------
;------------------- Memory Page 1 ----------------------
;--------------------------------------------------------
ORG 0100H
;----------------- Using RAM chip 1 ---------------------
;--------------------- RECORD ---------------------------
;Reset the start address to previous end address
REC1X JF1 PLAY1A ;If manual, keep playing
MOV A,R5 ;Get MS end addr byte
MOV R2,A ;Put into counter
MOV A,R6 ;Get LS end addr byte
MOV R1,A ;Put into counter
MOV R7,#0 ;Constant zero
;Start the A/D converter
REC1 ORL P2,#00000100B ;ST- = 1 2
ANL P2,#11111011B ;ST- = 0 2 A/D
JNI FAST1A ;Fast sampling? 2
CALL WAIT13 ;No, add 13 states (13)
;Read the A/D converter into accum
FAST1A MOVX A,@R1 ;Dummy to reset BUS 2
ANL P2,#11111101B ;RD- = 0 2
INS A,BUS ;Read A/D data on BUS 2
ORL P2,#00000010B ;RD- = 1 2
;Send accum data to D/A converter
OUTL BUS,A ;Send data to BUS 2
ANL P2,#01110110B ;WR-,LATCH-,CS1-=0 2
ORL P2,#00001000B ;WR- = 1 2 D/A
MOV R4,A ;Save sample 1
;Check whether overload is occurring. F0=1=yes.
MOV A,R2 ;MS byte addr 1
ANL A,#01111111B ;Turn LED on 2
JF0 ON1A ;Should be on? 2
ORL A,#10000000B ;No, turn off 2
JMP OFF1A ;Continue 2
ON1A NOP ; (1)
NOP ; (1)
NOP ; (1)
NOP ; (1)
;Put sample average into RAM at current address
;Send address to latches
OFF1A OUTL P1,A ;Out to port 1 2
ORL P2,#00000001B ;LATCH- = 1 2
MOV A,R1 ;LS byte addr 1
OUTL P1,A ;Out to port 1 2
;Send data to RAM
MOV A,R0 ;Get sample average 1
OUTL BUS,A ;Put onto BUS 2
ANL P2,#11011111B ;WE- = 0 2
ORL P2,#00100100B ;WE-=1, ST-=1 2
;Start the A/D converter
ANL P2,#11111011B ;ST- = 0 2 A/D
JNI FAST1B ;Fast sampling? 2
CALL WAIT13 ;No, add 13 states (13)
;Read the A/D converter into accum
FAST1B MOVX A,@R1 ;Dummy to reset BUS 2
ANL P2,#11111101B ;RD- = 0 2
INS A,BUS ;Read A/D data on BUS 2
ORL P2,#10000010B ;RD-=1;CS1-=1 2
;Send accum data to D/A converter
OUTL BUS,A ;Send data to BUS 2
ANL P2,#11110111B ;WR- = 0 2
ORL P2,#00001000B ;WR- = 1 2 D/A
;Check for overload - set F0 if yes.
CLR F0 ;LED flag off 1
JNZ OFF1B ;Overload? 2
CPL F0 ;Yes! Turn on (1)
JMP ON1B ;Continue (2)
OFF1B NOP ;Pad timing 1
NOP ; 1
NOP ; 1
;Find the average
ON1B ADD A,R4 ;Add old value 1
RRC A ;Average the two 1
MOV R0,A ;Save for later 1
;Increment address counters in R2:R1
MOV A,R1 ;Get LS byte 1
ADD A,#1 ;Bump LS byte 2
MOV R1,A ;Replace 1
MOV A,R2 ;Get MS byte 1
ADDC A,R7 ;Add carry + (R7=0) 1
MOV R2,A ;Replace 1
JB7 TEST1 ;Change RAM? 2
JF1 MAN2A ;Manual, stop rec.
JMP TEST0 ;Yes
TEST1 JT1 TC ;T1 up? Check T0 2
MOV A,R2 ;No, fix start addr
XRL A,#10000000B ;Addr 5 secs back
MOV R7,A ;Save as MS start
JMP PL1 ;Now play
TC JT0 REC1 ;T0 up? Keep rec. 2
MOV A,R2 ;Addr 10 secs back
MOV R7,A ;Save as MS start
PL1 MOV A,R1 ;LS byte addr
MOV R6,A ;Save LS start/end
MOV A,R2 ;Get MS addr end
MOV R5,A ;Save as MS end
;Set starting address for playing
START1 MOV A,R7 ;Get MS start
MOV R2,A ;Into counter
MOV A,R6 ;Get LS start
MOV R1,A ;Into counter
;------------------- PLAY --------------------------
;Get a byte from current address into accum
;Send address to latches
PLAY1 MOVX A,@R1 ;Dummy to reset BUS 2
ANL P2,#01111111B ;CS1- = 0 2
MOV A,R2 ;MS byte addr 1
ORL A,#10000000B ;Turn off LED 2
OUTL P1,A ;Out to port 1 2
ANL P2,#11111110B ;LATCH- = 0 2
ORL P2,#00000001B ;LATCH- = 1 2
MOV A,R1 ;LS byte addr 1
OUTL P1,A ;Out to port 1 2
ANL P2,#11101111B ;OE- = 0 2
INS A,BUS ;Read RAM data on BUS 2
ORL P2,#00010000B ;OE- = 1 2
ORL P2,#10000000B ;CS1- = 1 2
;Find the average
MOV R3,A ;Save sample for now 1
ADD A,R4 ;R4 = old sample 1
RRC A ;Find average 1
NOP ;Pad timing 1
NOP ; 1
NOP ; 1
NOP ; 1
NOP ; 1
;Send accum data to D/A converter
JNI FAST1C ;Fast sampling? 2
CALL WAIT13 ;No, add 13 states (13)
FAST1C OUTL BUS,A ;Send data to BUS 2
ANL P2,#11110111B ;WR- = 0 2
ORL P2,#00001000B ;WR- = 1 2 D/A
;Increment address counters in R2:R1
MOV A,R1 ;Get LS byte 1
ADD A,#1 ;Bump LS byte 2
MOV R1,A ;Replace 1
MOV A,R2 ;Get MS byte 1
ADDC A,#0 ;Add carry 2
MOV R2,A ;Replace 1
JB7 TE ;Change RAM? 2
JF1 MAN2A ;Manual, stop play
JMP TST0 ;Yes
TE MOV A,R1 ;Get LS addr 1
XRL A,R6 ;At end? 1
JNZ TST1 ;Not yet 2
MOV A,R2 ;Get MS addr 1
XRL A,R5 ;At end? 1
JZ START1 ;Yes, restart 2
TST1 JT1 TD ;T1 up? 2
JMP PLAY1A ;No, play sound 2
TD JT0 REC1X ;Finished playing?
PLAY1A MOV A,R3 ;Recall new sample 1
MOV R4,A ;Make into old 1
CALL WAIT13 ;Wait 13 states 13
NOP ;Pad timing 1
;Send sample to D/A converter
JNI FAST1D ;Fast sampling? 2
CALL WAIT13 ;No, add 13 states (13)
FAST1D OUTL BUS,A ;Send data to BUS 2
ANL P2,#11110111B ;WR- = 0 2
ORL P2,#00001000B ;WR- = 1 2 D/A
JMP PLAY1 ;Keep playing 2
MAN2A JMP MAN2 ;Cross page jumps
;--------------------------------------------------------
;------------------- Memory Page 2 ----------------------
;--------------------------------------------------------
ORG 0200H
;---------------------------------------------------
INIT ;Initialize ports, BUS, and memories
SEL RB0 ;Use RAM register bank 0
SEL MB0 ;...and EPROM mem bank 0
MOV A,#11111111B ;All ones
OUTL P1,A ;Port 1 = 11111111B
OUTL BUS,A ;BUS = 11111111B
MOV A,#11111011B ;ST- idles low
OUTL P2,A ;Port 2 = 11111011B
MOV R7,#0 ;MS start addr
MOV R6,#0 ;LS start addr
MOV R5,#0 ;MS end addr
MOV R4,#0 ;Temp sample storage
MOV R3,#0 ;Temp sample storage
MOV R2,#0 ;MS curr addr
MOV R1,#0 ;LS curr addr
MOV R0,#127 ;sample average
CLR F0 ;Overload LED off
CLR F1 ;Automatic mode
RETR
;---------------------------------------------------
CLEAR ;Clear RAM memory, two bytes at a time
MOV A,#127 ;"zero" sample voltage
OUTL BUS,A ;Send to BUS/RAM
MOV R2,#00000000B ;MS address = 0; LED on
MOV R1,#00000000B ;LS address = 0
ANL P2,#00111111B ;CS0-,CS1-=0
MORCLR MOV A,R2 ;MS address
OUTL P1,A ;To latch
ANL P2,#11111110B ;LATCH-=0
ORL P2,#00000001B ;LATCH-=1
MOV A,R1 ;LS address
OUTL P1,A ;To port 1
ANL P2,#11011111B ;WE-=0
ORL P2,#00100000B ;WE-=1
MOV A,R1 ;LS address
ADD A,#1 ;Bump address
MOV R1,A ;Replace
MOV A,R2 ;MS address
ADDC A,#0 ;Add carry
MOV R2,A ;Replace
JB7 NOCLR ;More than 32k ?
JMP MORCLR ;Continue
NOCLR ORL P2,#11000000B ;CS0-,CS1-=1
RETR ;Finished
;---------------------------------------------------
MANUAL ;Manual record/play mode requested
CALL CLEAR ;Clear all of RAM memory
MAN3 JNT0 MAN3 ;Wait for key up
CALL DEBOUN ;Debounce key
CALL LEDON ;Turn on LED
;Get a sample and output to DAC
WAIT1 CALL SAMPLE ;A/D and D/A
JNT1 CANCEL ;Press T1 to cancel
JT0 WAIT1 ;T0 up, wait
CALL LEDOFF ;Turn off LED
CLR F1 ;Ready to set F1
CPL F1 ;F1=1, LED is off
JMP RECMAN ;Record from start
MAN2 ;Back from recording or playing 64k
CALL LEDON ;Turn on LED
;Get a sample and output to DAC
WAIT2 CALL SAMPLE ;A/D and D/A
JNT1 CANCEL ;Press T1 to cancel
JT0 WAIT2 ;Wait for T0 press
JMP PLAY0 ;Now play 64k
CANCEL ;T1 was pressed while in Memory Idle modes.
;Cancel Memory mode.
CALL INIT ;Initialize & clear flag
CALL LEDOFF ;Turn off LED
JMP REC0X ;"Warm" reboot
;---------------------------------------------------
SAMPLE ;Do A/D and D/A conversion
ORL P2,#00000100B ;ST- = 1
ANL P2,#11111011B ;ST- = 0
MOVX A,@R1 ;Dummy to reset BUS
ANL P2,#11111101B ;RD- = 0
INS A,BUS ;Read A/D on BUS
ORL P2,#00000010B ;RD- = 1
OUTL BUS,A ;Send data to BUS
ANL P2,#11110111B ;WR- = 0
ORL P2,#00001000B ;WR- = 1
RETR
;---------------------------------------------------
LEDON ;Turn on LED
ANL A,#01111111B ;Turn on LED
OUTL P1,A ;Out to port 1
ANL P2,#11111110B ;LATCH- = 0
ORL P2,#00000001B ;LATCH- = 1
RETR
;---------------------------------------------------
LEDOFF ;Turn off LED
ORL A,#10000000B ;Turn off LED
OUTL P1,A ;Out to port 1
ANL P2,#11111110B ;LATCH- = 0
ORL P2,#00000001B ;LATCH- = 1
RETR
;---------------------------------------------------
DEBOUN ;Wait 50 milliseconds
CALL MS10 ;Wait 10 ms.
CALL MS10 ;Wait 10 ms.
CALL MS10 ;Wait 10 ms.
CALL MS10 ;Wait 10 ms.
CALL MS10 ;Wait 10 ms.
RETR
;---------------------------------------------------
MS10 ;Use timer to time 10 ms., approximately.
;Timer counts at a rate of xtal/15/32 Hz
;= 23.04 kHz (43.4028 us/count).
MOV A,#26 ;230 counts
MOV T,A ;Into timer
STRT T ;Start timer
NOTFIN JTF TIMFIN ;Finished
JMP NOTFIN
TIMFIN RETR
;---------------------------------------------------
WAIT13 ;Wait 13 states including CALL and RETR
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
RETR
;--------------------------------------------------------
;------------------- Memory Page 3 ----------------------
;--------------------------------------------------------
;--------------------------------------------------------
ORG 03B0H
NOTICE ;Copyright notice takes from 03B0H to 03FEH
DB ' (c) copyright 1993,'
DB ' Reyer & Associates,'
DB ' WA9VNJ QSOcorder'
DB ' version 2.3'
DB ' 10/17/93'
DB ' '
END